import axios from "axios";
import { message } from "antd";

const request = axios.create({
  baseURL:'http://192.168.0.101:4011',
  timeout:5000
})

request.interceptors.request.use(
  (config)=>{
    return config
  },(err)=>{
    return Promise.reject(err)
  }
)

request.interceptors.response.use(
  (res)=>{
    return res
  },
  (err)=>{
    return message.open({
      type:'error',
      content:err
    })
    // return Promise.reject(err)
  }
)

export {request}